Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

man/io_uring_prep_recv: expand on how to handle bundles #1328

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

romange
Copy link
Contributor

@romange romange commented Jan 15, 2025

Specifically, explain how to identify multiple buffer ids upon bundle completion.


git request-pull output:

The following changes since commit a5dd7f85d4b667aeb687afc562ff9750044b42c2:

  man/io_uring_clone_buffers: mention that both rings must share mm (2025-01-14 11:06:56 -0700)

are available in the Git repository at:

  https://github.com/romange/liburing Pr1

for you to fetch changes up to c7a6b36b3c78d26bec2ffc8fb393e38f9ac16743:

  man/io_uring_prep_recv: expand on how to handle bundles (2025-01-15 20:29:58 +0200)

----------------------------------------------------------------
Roman Gershman (1):
      man/io_uring_prep_recv: expand on how to handle bundles

 man/io_uring_prep_recv.3 | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Click to show/hide pull request guidelines

Pull Request Guidelines

  1. To make everyone easily filter pull request from the email
    notification, use [GIT PULL] as a prefix in your PR title.
[GIT PULL] Your Pull Request Title
  1. Follow the commit message format rules below.
  2. Follow the Linux kernel coding style (see: https://github.com/torvalds/linux/blob/master/Documentation/process/coding-style.rst).

Commit message format rules:

  1. The first line is title (don't be more than 72 chars if possible).
  2. Then an empty line.
  3. Then a description (may be omitted for truly trivial changes).
  4. Then an empty line again (if it has a description).
  5. Then a Signed-off-by tag with your real name and email. For example:
Signed-off-by: Foo Bar <[email protected]>

The description should be word-wrapped at 72 chars. Some things should
not be word-wrapped. They may be some kind of quoted text - long
compiler error messages, oops reports, Link, etc. (things that have a
certain specific format).

Note that all of this goes in the commit message, not in the pull
request text. The pull request text should introduce what this pull
request does, and each commit message should explain the rationale for
why that particular change was made. The git tree is canonical source
of truth, not github.

Each patch should do one thing, and one thing only. If you find yourself
writing an explanation for why a patch is fixing multiple issues, that's
a good indication that the change should be split into separate patches.

If the commit is a fix for an issue, add a Fixes tag with the issue
URL.

Don't use GitHub anonymous email like this as the commit author:

Use a real email address!

Commit message example:

src/queue: don't flush SQ ring for new wait interface

If we have IORING_FEAT_EXT_ARG, then timeouts are done through the
syscall instead of by posting an internal timeout. This was done
to be both more efficient, but also to enable multi-threaded use
the wait side. If we touch the SQ state by flushing it, that isn't
safe without synchronization.

Fixes: https://github.com/axboe/liburing/issues/402
Signed-off-by: Jens Axboe <[email protected]>

By submitting this pull request, I acknowledge that:

  1. I have followed the above pull request guidelines.
  2. I have the rights to submit this work under the same license.
  3. I agree to a Developer Certificate of Origin (see https://developercertificate.org for more information).

Specifically, explain how to identify multiple buffer ids upon bundle completion.

Signed-off-by: Roman Gershman <[email protected]>
@romange
Copy link
Contributor Author

romange commented Jan 15, 2025

Consider this a draft. Once the wording is finalized I will copy it to another man page where we duplicate the explanation about bundles. In addition, I can add the necessary code to proxy.c (as part of this PR or separately)

The buffers consumed will be contiguous from the initial buffer, in the order
in which they appear in the buffer ring. The CQE struct does not contain the position
of the buffer in the bufring, therefore in order to identify buffers contained by the bundle,
it is advised to maintain the cached head index per bufring. This uint16_t index represents the position of the next buffer to be consumed within the ring. Upon completion of a receive operation on a buffer ring, the cached head index should be incremented accordingly.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please break lines at 80 chars. And use "buffer ring" rather than "bufring", generally that's the term used in man pages.

Outside of that, looks fine to me.

@romange
Copy link
Contributor Author

romange commented Jan 16, 2025

Done. Also added the proxy changes. How do you usually test proxy? with what loadtest program?

@axboe
Copy link
Owner

axboe commented Jan 16, 2025

Please squash the fixup commit to retain some git hygiene, there's no point in having fixup commits in the log.

@axboe
Copy link
Owner

axboe commented Jan 16, 2025

How do you usually test proxy? with what loadtest program?

Most testing I've done has just been with a simple test program I wrote, which spawns N threads sending M sized buffers. In other words, I think anything really will work, just ensure you have recv bundles enabled of course. If it were me, I'd test one in sink mode, and one in fwd mode where it just dumps it to ncat or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants